<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Edu-Skill - Education Template</title>
    <!-- Chosen CSS -->
    <link href="/${res}/css/dashboard.css" rel="stylesheet">
    <!-- Custom Main StyleSheet CSS -->
    <link href="/${res}/style.css" rel="stylesheet">
    <!-- Color CSS -->
    <link href="/${res}/css/color.css" rel="stylesheet">
    <!-- Responsive CSS -->
    <link href="/${res}/css/responsive.css" rel="stylesheet">

</head>

<body>
<!--gt Wrapper Start-->
<div class="gt_wrapper">
    <!--Header Wrap Start-->
    [#include "../include/nav.html"/]
    <!--Header Wrap End-->

    <!--Sub Banner Wrap Start -->
    <!--    <div class="gt_sub_banner_bg default_width">
            <div class="container">
                <div class="gt_sub_banner_hdg  default_width">
                    <h2>My Profile</h2>
                    <h6>Welcome To Educskill</h6>
                </div>
            </div>
        </div>-->
    <!--Sub Banner Wrap End -->
    <!--Breadcrumb Wrap End -->
    <div class="gt_breadcrumb_bg default_width">
        <div class="container">
            <div class="gt_breadcrumb_wrap default_width">
                <ul>
                    <li><a href="#">Home</a></li>
                    <li><a href="#">My Profile</a></li>
                </ul>
            </div>
        </div>
    </div>
    <!--Breadcrumb Wrap End -->

    <!--Main Content Wrap Start-->
    <div class="gt_content_wrap">
        <!--Classes Wrap Start-->
        <section class="gt_courses_bg">
            <div class="container">
                <div class="col-md-4">
                    <div class="gt-user-sidebar">
                        <div class="gt_d_author_wrap">
                            <div class="gt_d_author_pic">
                                <figure>
                                    [#if user.userImg??]<img src="${base}/${user.userImg}">[#else]<img
                                        src="/${res}/images/userImg-large.png">
                                    [/#if]
                                    <a href="${base}/member/portrait.jspx"> 更换头像</a>
                                </figure>
                            </div>
                            <div class="gt_d_author_pic_des">
                                <h5>${user.username}</h5>
                                <span class="gt_hdg_span"></span>
                                <p>Phon ID</p>
                                <label>${user.mobile!?html}</label>
                            </div>
                            <div class="gt_d_author_sbj">
                                <h6>会员组别</h6>
                                <span>${user.group.name}</span>
                                <h6>自我介绍</h6>
                                <span>${user.intro!}</span>

                            </div>
                        </div>
                        <div class="gt-usser-account-list">
                            <ul>
                                <li><a href="${base}/member/index.jspx" class="on"><i class="icon-book gt-color"></i>个人资料</a>
                                </li>
                                <li><a href="${base}/member/contribute_list.jspx"><i class="icon-book gt-color"></i>投稿管理</a>
                                </li>
                                <li><a href="${base}/member/resume.jspx"><i class="icon-book gt-color"></i>应聘管理</a></li>
                                <li><a href="${base}/member/mycomments.jspx"><i class="icon-book gt-color"></i>我的评论</a>
                                </li>
                                <li><a href="${base}/member/myguestbook.jspx"><i class="icon-book gt-color"></i>我的留言</a>
                                </li>
                                <li><a href="${base}/member/collection_list.jspx"><i class="fa fa-heart gt-color"></i>我的收藏</a>
                                </li>
                                <li><a href="${base}/member/message_mng.jspx"><i class="icon-book gt-color"></i>站内信息</a>
                                </li>
                                <li><a href="${base}/member/account.jspx"><i class="icon-book gt-color"></i>服务中心</a>
                                </li>
                            </ul>
                            <a href="#" class="gt-logout"><i class="icon-arrows-2 gt-color"></i>安全退出</a>
                        </div>
                    </div>
                </div>
                <!-- Dashboard Side Bar Wrap End -->

                <!--Classes List Wrap Start-->
                <div class="col-md-8">
                    <div class="gt_d_classes_wrap default_width mb20">
                        <div class="member-main">
                            <div class="member-child"><a href="${base}/member/contribute_list.jspx" >稿件列表</a>|<a href="${base}/member/contribute_add.jspx" class="on">发布稿件</a></div>
                            <div style="padding: 30px 0px;">
                                [#if channelList?size gt 0]
                                [#include "media_upload.html"/]
                                [#include "image_upload.html"/]
                                [#include "attachment_upload.html"/]
                                <div id="jvForm" action="contribute_save.jspx" class="form-horizontal" method="post">
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">标题：</label>
                                        <div class="col-md-8">
                                            <input type="text" name="title" maxlength="150" class="form-control required" /><span style="color:#f00; margin-left:10px;">*</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">TAGS：</label>
                                        <div class="col-md-8">
                                            <input type="text" name="tagStr" maxlength="255" class="form-control"/><span style=" margin-left:10px;">用 , 分割</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">作者：</label>
                                        <div class="col-md-8">
                                            <input type="text" name="author" maxlength="100" class="form-control" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">栏目：</label>
                                        <div class="col-md-8">
                                            <select name="channelId" class="form-control">
                                                <option value="" class="sel-disabled">--请选择--</option>
                                                [#if channelList?size gt 0]
                                                [#assign origDeep=channelList[0].deep+1/]
                                                [#list channelList as c]
                                                <option value="${c.id}"[#if c.child?size gt 0] class="sel-disabled"[/#if]>[#if c.deep gte origDeep][#list origDeep..c.deep as i]&nbsp;&nbsp;[/#list]>[/#if]${c.name}</option>
                                                [/#list]
                                                [/#if]
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">摘要：</label>
                                        <div class="col-md-8">
                                            <textarea name="form-description" class="form-control" rows="3" cols="70" maxlength="255"></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">收费设置：</label>
                                        <div class="col-md-8">
                                            免费:<input name="charge" class="form-control" value="0" checked="checked" onclick="changeModel()" type="radio"/>
                                            收费:<input name="charge" class="form-control" value="1" onclick="changeModel()" type="radio"/>
                                            打赏:<input name="charge" class="form-control" value="2" onclick="changeModel()" type="radio"/>
                                            <span id="chargeAmountSpan">金额:<input type="text"  name="chargeAmount" value="0" required="true" class="required number form-control" maxlength="10" style="width:100px"/></span>
                                            <span id="rewardSpan">
                                            随机:<input name="rewardPattern" class="form-control" value="false"  [#if !contentChargeConfig.rewardPattern]checked="checked"[/#if] type="radio" required="true"  onclick="changePattern()"/>
                                            固定:<input name="rewardPattern" class="form-control" value="true"  [#if contentChargeConfig.rewardPattern]checked="checked"[/#if] type="radio" required="true"  onclick="changePattern()"/>
                                            <div id="rewardFixDiv">
                                            固定:
                                            [#list config.rewardFixAttr?keys?sort as fix]
                                            <input type="text" name="rewardFix" value="${config.rewardFixAttr[fix]!}" required="true" class="required number form-control" maxlength="10" style="width:50px"/>
                                            [/#list]
                                            </div>
                                            <div id="rewardRandomDiv">
                                            随机范围:
                                            <input type="text" name="rewardRandomMin" value="${contentChargeConfig.rewardMin!}" required="true" class="required number form-control" maxlength="10" style="width:50px"/>
                                            <input type="text" name="rewardRandomMax" value="${contentChargeConfig.rewardMax!}" required="true" class="required number form-control" maxlength="10" style="width:50px"/>
                                            </div>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">多媒体：</label>
                                        <div class="col-md-8">
                                            <div>
                                                <input type="text" id="mediaPath" name="mediaPath" class="member-change" style="width:303px"/>
                                            </div>
                                            <div>
                                                <span id="mfc" style="position:relative;display:block;line-height:28px;margin-top:4px;">
                                                <input type='text' id='mediaFileText' class="form-control" style="float:left;margin-left:15px;"/>
                                                <input class="change-Btn" type='button' value='浏览' style="float:left;margin-left:4px;" />
                                                <input onchange="$('#mediaFileText').val(this.value)" size="19" type="file" name="mediaFile" id="mediaFile" style="height:28px;width:246px;opacity:0;filter:alpha(opacity=0);position:absolute;left:15px;top:0;"/>
                                                <input type="button" value="上传" onclick="uploadMedia();" class="change-Btn"  style="float:left;"/>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">播放器：</label>
                                        <div class="col-md-8">
                                            [@p.radio name="mediaType" list=["WM","REAL","FLV","FLASH","CK"] value="CK"/]
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">内容：</label>
                                        <div class="col-md-8">
                                            <textarea id="txt" name="txt"></textarea>
                                            <script type="text/javascript">
                                                $(function() {
                                                    CKEDITOR.replace( 'txt' ,
                                                        {
                                                            filebrowserUploadUrl : '${base}/fck/upload.jspx',
                                                            filebrowserImageUploadUrl : '${base}/fck/upload.jspx?Type=Image',
                                                            filebrowserFlashUploadUrl : '${base}/fck/upload.jspx?Type=Flash',
                                                            filebrowserMediaUploadURL : '${base}/fck/upload.jspx?Type=Media'
                                                        }
                                                    );
                                                });
                                            </script>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">附件：</label>
                                        <div class="col-md-8">
                                            <div>
                                                <input type="button" style="width:40px;height:24px;cursor:pointer;background:#3694d7;color:#fff;font-size:12px;cursor:pointer;" id="fileupload" value="上传"/>
                                                <input id="docfileupload" style='display:none' type="file" name="Filedata" data-url="o_swfAttachsUpload.jspx" multiple />
                                                <script>
                                                    $(function () {
                                                        $('#fileupload').click(function(){
                                                            $('#docfileupload').trigger('click');
                                                        })

                                                        $('#docfileupload').fileupload({
                                                            dataType: 'json',
                                                            add: function (e, data) {
                                                                data.submit();
                                                            },
                                                            done: function (e, data) {
                                                                addAttachLine();
                                                                var index = attachIndex - 1;
                                                                $("#attachmentPaths"+index).val(data.result.attachUrl);
                                                                $("#attachmentNames"+index).val(data.result.attachName);
                                                            },
                                                            progressall: function (e, data) {
                                                                $("#submit").prop("disabled","disabled");
                                                            }
                                                        });
                                                    });
                                                </script>
                                                <span style="display: none;"><input class="cancel" id="abtnCancel" type="button" value="取消" onclick="swfu.cancelQueue();" disabled="disabled" /></span>
                                                <div id="afsUploadProgress" style="display: none;"></div> </div>
                                                <table id="attachTable" border="0" class="fbgj-fj">
                                                    <tr>
                                                        <td align="center">附件名称</td>
                                                        <td align="center">路径</td>
                                                        <td align="center">上传</td>
                                                        <td align="center"></td>
                                                    </tr>
                                                </table>
                                                <textarea id="attachTr" style="display:none">
                                                    <div id="attachTr{0}">
                                                        <div align="center"><input type="text" id="attachmentNames{0}" name="attachmentNames" class="member-change" style="width:100px;height:24px;"/></div>
                                                        <div align="center"><input type="text" id="attachmentPaths{0}" name="attachmentPaths" class="member-change" style="width:130px;height:24px;"/></div>
                                                        <div align="center">
                                                            <span id="afc{0}" style="position:relative;display:block;width:200px;">
                                                            <input type='text' id='attachmentText{0}' class="member-change" style="width:150px;height:24px;" />
                                                            <input onchange="$('#attachmentText{0}').val(this.value)" size="19" type="file" name="attachmentFile" id="attachmentFile{0}" style="height:24px;width:200px;opacity:0;filter:alpha(opacity=0);position:absolute;left:0;top:0;"/>
                                                            <input type="button" value="上传" onclick="uploadAttachment({0});" style="width:40px;height:24px;cursor:pointer;background:#3694d7;color:#fff;font-size:12px;cursor:pointer;" />
                                                            </span>
                                                            <input type="hidden" id="attachmentFilenames{0}" name="attachmentFilenames"/>
                                                        </div>
                                                        <div align="center" width="50"><a onclick="$('#attachTr{0}').remove();" href="javascript:void(0);" class="pn-opt">删除</a></div>
                                                    </div>
                                                </textarea>
                                                <script type="text/javascript">
                                                    var attachIndex = 1;
                                                    var attachTpl = $.format($("#attachTr").val());
                                                    function addAttachLine() {
                                                        $('#attachTable').append(attachTpl(attachIndex++));
                                                    }
                                                </script>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">图片集：</label>
                                        <div class="col-md-8">
                                            <div>
                                                <input type="button" style="width:40px;height:24px;cursor:pointer;background:#3694d7;color:#fff;font-size:12px;cursor:pointer;" id="fileupload1" value="上传"/>
                                                <input id="docfileupload1" style='display:none' type="file" name="Filedata" data-url="o_swfPicsUpload.jspx" multiple>
                                                <script>
                                                    $(function () {
                                                        $('#fileupload1').click(function(){
                                                            $('#docfileupload1').trigger('click');
                                                        })

                                                        $('#docfileupload1').fileupload({
                                                            dataType: 'json',
                                                            add: function (e, data) {
                                                                data.submit();
                                                            },
                                                            done: function (e, data) {
                                                                addPicLine();
                                                                var index = picIndex - 1;
                                                                imgUrl=data.result.imgUrl;
                                                                $("#preImg"+index).attr("src",""+imgUrl);
                                                                var imgSrc = parent.document.getElementById("preImg"+index);
                                                                if(!$(imgSrc).attr("noResize")) {
                                                                    $(imgSrc).css("width","auto");
                                                                    $(imgSrc).css("height","auto");
                                                                }
                                                                $("#uploadImgPath"+index).val(imgUrl);
                                                            },
                                                            progressall: function (e, data) {
                                                                $("#submit").prop("disabled","disabled");
                                                            }
                                                        });
                                                    });
                                                </script>
                                                <span style="display: none;"><input class="cancel" id="btnCancel" type="button" value="取消" onclick="swfu.cancelQueue();" disabled="disabled" /></span>
                                                <div id="fsUploadProgress" style="display: none;"></div>
                                            </div>
                                            <div id="picBefore" style="clear:both"></div>
                                            <div id="picTable" style="display:none;">
                                                <table id="picTable{0}" border="0" cellpadding="0" cellspacing="0" class="fbgj-tab">
                                                    <tr>
                                                        <td style="line-height:1;">
                                                            <div><input type="text" id="uploadImgPath{0}" name="picPaths" class="member-change" /> <a href="javascript:void(0);" onclick="$('#picTable{0}').remove();" class="pn-opt">删除</a></div>
                                                            <div style="margin-top:4px;">
                                                            <span id="ufc{0}" style="position:relative;">
                                                            <input type='text' id='uploadFileText{0}' size="10" class="member-change" style="width:115px;height:22px;"/>
                                                            <input onchange="$('#uploadFileText{0}').val(this.value)" size="10" type="file" id="uploadFile{0}" style="width:72px;height:22px;"/></span>
                                                            <input type="button" value="上传" onclick="upload({0});" style="width:50px;height:22px;cursor:pointer;background:#3694d7;color:#fff;font-size:12px;"/></div>
                                                            <div><textarea style="width:300px;height:60px;margin-bottom:0;" name="picDescs" maxlength="255"></textarea></div>
                                                        </td>
                                                        <td><img id="preImg{0}" alt="预览" noResize="true" style="width:110px;height:110px;background-color:#ccc;border:1px solid #c7c7c7;"/></td>
                                                    </tr>
                                                </table>
                                            </div>
                                            <script type="text/javascript">
                                                var picIndex = 1;
                                                var picTpl = $.format($("#picTable").html());
                                                function addPicLine() {
                                                    $('#picBefore').before(picTpl(picIndex++));
                                                }
                                            </script>
                                        </div>
                                    </div>
                                    [#if contentChargeModel??&&contentChargeModel==2]
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">收费金额：</label>
                                        <div class="col-md-8">
                                            <input name="charge" value="true" type="hidden"/>
                                            <input type="text" name="chargeAmount" maxlength="20" class="member-change"/>
                                        </div>
                                    </div>
                                    [/#if]
                                    <div class="form-group">
                                        <label class="col-md-4 control-label">验证码：</label>
                                        <div class="col-md-8">
                                            <input type="text" name="captcha" maxlength="20" class="member-change" style="float:left; margin-left:15px;" /><img id="guestbookCaptcha" src="${base}/captcha.svl" onclick="this.src='${base}/captcha.svl?d='+new Date()"/>
                                        </div>
                                    </div>
                                    <button type="button" class="btn btn-lg btn-success center-block">修 &nbsp;&nbsp; 改</button>
                                </form>
                                [#else]
                                <div>系统不允许投稿，请联系管理员！</div>
                                [/#if]
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!--Classes Wrap End-->
    </div>

    <div class="back-to-top">
        <a href="#home"><i class="fa fa-angle-up"></i></a>
    </div>
    <!--Back to Top Wrap Start-->

</div>
<!--gt Wrapper End-->

<!--Jquery Library-->
<script src="${resSys}/jquery.js" type="text/javascript"></script>
<script src="${resSys}/front.js" type="text/javascript"></script>
<!--Bootstrap core JavaScript-->
<script src="/${res}/js/bootstrap.min.js"></script>
<!--Custom JavaScript-->
<script src="/${res}/js/custom.js"></script>
<script src="${base}/thirdparty/ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="${base}/res/common/js/jquery.ui.widget.js" type="text/javascript"></script>
<script src="${base}/res/common/js/jquery.iframe-transport.js" type="text/javascript"></script>
<script src="${base}/res/common/js/jquery.fileupload.js" type="text/javascript"></script>
<script type="text/javascript">
    $.validator.methods.leafChannel = function(value, element, param) {
        var i = element.selectedIndex;
        return $(element.options[i]).attr("class")!="sel-disabled";
    }
    $(function() {
        $("#jvForm").validate({
            rules: {
                channelId: {
                    required: true,
                    leafChannel: true
                }
            },
            messages:{
                channelId: {
                    leafChannel: "请选择末级栏目"
                }
            }
        });

    });



</script>

</body>
</html>
